import request from '../../../utils/request'

function getAllRole() {
  return request({
    url: './admin/role/getList',
    method: 'get'
  })
}

function getRole(params) {
  return request({
    url: '/admin/role/getPage',
    method: 'get',
    params
  })
}

function addRole(data) {
  return request({
    url: '/admin/role',
    method: 'post',
    data
  })
}

function editRole(data) {
  return request({
    url: '/admin/role',
    method: 'put',
    data
  })
}

function delRole(data) {
  return request({
    url: '/admin/role',
    method: 'delete',
    data
  })
}

export { getAllRole, getRole, addRole, editRole, delRole }
